import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
  routes: [
    { path: '/', redirect: '/home', meta: {title: '首页'}},
    { path: '/home', name: 'Home', component: resolve => require(['../page/home/Home'], resolve), meta: { title: '首页', fontSize6: '57.8704' }},
  ]
})
export function whitePage () {
  return router.options.routes
}

router.beforeEach((to, from, next) => {
  next()
})

router.afterEach((to, from) => {
  if (to.path) {
    document.title = to.meta.title || '中国移动触屏营业厅'
  }
})

export default router
